#ifndef LEVEL_H
#define LEVEL_H

#include "MegaSprite.h"
#include "Entity.h"
#include "String.h"

class CLevel
{
    
public:
    
    ~CLevel()
    {
        
        delete [] m_iMaskData;
        
    }
    
    void load(String sName);
    
    void drawBackground();
    
    void drawForeground();
    
    void collideWith(CEntity* pEntity);
    //void collideWith(CPlayer* player);
    
    long*& getMaskData()        { return m_iMaskData; }
    
private:
    
    int countCollidingPixels(Vector vPos, Scalar fRadius);
    long getMaskValue(Vector vPos);
    
    long* m_iMaskData;
    int m_iMaskWidth;
    int m_iMaskHeight;
    
    CMegaSprite m_Background;
    CMegaSprite m_Foreground;
    
};

#endif //LEVEL_H
